﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using DataLib.Accounts.Bus;

namespace Ewts.Storage
{
    public partial class PDList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {

                if (Session["UserInfo"] != null)
                {
                    User curUser = new DataLib.Accounts.Bus.User();
                    curUser = (User)Session["UserInfo"];
                    string city = "";
                    if (curUser.UserType != "AD")
                    {
                        city = curUser.CompanyCity;
                    }
                    bindData(city);
                }
                else
                {
                    Response.Redirect("/accounts/login.aspx");
                }
                
            }

        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="username"></param>
        /// <param name="cumid"></param>
        private void bindData(string city)
        {
            DataTable dt = new DataTable();
            dt = new DataLib.BLL.BarCode().GetPDList(city, "");
            //dt = new DataLib.BLL.ProjectsRelation().getAddressByUserName(username, 5,cumid);
            rept.DataSource = dt;
            rept.DataBind();
        }

        protected void btnPD_Click(object sender, EventArgs e)
        {
            Response.Redirect("/Storage/StartStorage.aspx?insid=0");
        }
    }
}